<?php
namespace Auth\Controller;
use Think\Controller;
class CommonController extends Controller {

    //权限验证
    public function _initialize(){
        //$url = MODEL_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME;
        //var_dump($url);
    }
    
    //ajax 返回数据，$code 编号正确为1，错误未0，$info
    //返回json串
    public function ajaxReturn($code,$info,$msg=""){
        $return = array();
        $return["code"] = $code;
        $return["msg"] = $msg;
        $return["info"] = $info;
        echo json_encode($return);
        exit;
    }

    protected function getButtonHtml(){
        $buttonModel = D("Auth/AuthButton");
        $buttonList = $buttonModel->select();
        $this->assign("buttonList",$buttonList);
        $html = $this->fetch("/Public/button");
        $this->assign("btnHtml",$html);
    }
}